package com.hxzy.controller.admin.contamer;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hxzy.common.controller.BaseController;
import com.hxzy.common.resp.R;
import com.hxzy.controller.admin.contamer.req.ContamerSearchReq;
import com.hxzy.controller.admin.contamer.resp.ContamerResp;
import com.hxzy.service.ContamerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "后台-客户Api")
@RestController
@RequestMapping(value = "/api/contamer")
public class ContamerController extends BaseController {


    @Autowired
    private ContamerService contamerService;


    // http://localhost:9528/dev-api/api/contamer/data?page=1&size=10&beginTime=2024-02-02&endTime=2024-02-10
    // request.getParameter("page")
    @ApiOperation(value = "分页查询")
    @GetMapping(value = "/data")
    public R<PageInfo<ContamerResp>> search(ContamerSearchReq req){
        //1、开启分页
        super.startPage(req);
        //2、查询条件
        List<ContamerResp> list=this.contamerService.search(req);

        //3、返回结果
        return super.buildPageInfo(list);
    }













}
